package io.wins.vertx.entity;

import io.vertx.codegen.annotations.DataObject;
import io.vertx.core.json.JsonObject;
import io.wins.vertx.utils.UUIDUtils;
import org.apache.commons.lang3.StringUtils;

@DataObject(generateConverter = true)
public class FaceValues {
    public final String id;
    public String parentId;
    public String name;
    public float price;
    public long count;

    public FaceValues(final JsonObject json) {
        FaceValuesConverter.fromJson(json, this);
        this.id = StringUtils.isEmpty(json.getString("id")) ?
            UUIDUtils.genId() : json.getString("id");
    }
    public JsonObject toJson() {
        final JsonObject json = new JsonObject();
        FaceValuesConverter.toJson(this, json);
        return json;
    }

    public String getId() {
        return this.id;
    }

    public String getParentId() {
        return this.parentId;
    }

    public void setParentId(final String parentId) {
        this.parentId = parentId;
    }

    public String getName() {
        return this.name;
    }

    public void setName(final String name) {
        this.name = name;
    }

    public float getPrice() {
        return this.price;
    }

    public void setPrice(final float price) {
        this.price = price;
    }

    public long getCount() {
        return this.count;
    }

    public void setCount(final long count) {
        this.count = count;
    }
}
